package org.bite.lesson09;

import java.util.concurrent.TimeUnit;

public class Demo903 {
    public static void main(String[] args) throws InterruptedException {
        MyThreadPool threadPool = new MyThreadPool(3);
        for(int i = 0; i < 10; i++){
            int taskId = i + 1;
            threadPool.submit(()->{
                System.out.println("执行线程任务" + taskId + "," + Thread.currentThread().getName());

            });
            if(taskId % 2 == 0){
                TimeUnit.SECONDS.sleep(1);
            }
        }
    }
}
